<?php
	/**
	* Currency Management
	* @author: trungdt
	* @since: Oct 13, 2011
	* @version: 1.0
	* 
	*/
	if (!defined("EXPONENT")) exit("");
	if (exponent_permissions_check(array("administrate"), $loc))
	{
		global $db;

		$currency=$db->selectObjects("productsmodule_currency");
		
		foreach ($currency as $k=>$v){
			//Get the image file if there is one.
			if (isset($v->flag_id) && ($v->flag_id > 0)) {
				$file = $db->selectObject('file', 'id='.$v->flag_id);
				$v->flag_path = URL_FULL.$file->directory.'/'.$file->filename;
			}
			else
				$v->flag_path="";
		}
		
		$template = new template("productsmodule","_currency_management",$loc);
		$template->register_permissions(array('administrate',"configure"),$loc);
		$template->assign('currency', $currency);
		exponent_flow_set(SYS_FLOW_PUBLIC, SYS_FLOW_ACTION);
		$template->output();
	}
	else
	{
		echo SITE_403_HTML;
	}
?>